declare variable $name external;
declare variable $size as xs:integer external;
declare variable $offsetX external;
declare variable $offsetY external;
declare variable $filtername external;

for $icone in //icone

let $subsize := $icone/*:svg/@height

where $icone/@name = $name

return element {QName("http://www.w3.org/2000/svg","svg")}
        {  attribute height {$size+20}, attribute width {$size+20},


element {QName("http://www.w3.org/2000/svg","g")}
        {
          attribute transform {
concat(concat(concat(concat( "translate(" , $offsetX ),concat( "," , $offsetY )),concat( ") scale(" , $size div $subsize )),")")
},
        attribute style {$filtername},
    $icone/*
}
}
